<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page import="com.kaisheng.util.IntervalUtil" %>

<!DOCTYPE html>
<html lang="zh-CN"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="static/css/bootstrap.min.css">
	<style type="text/css">
		body{
			background-image:url(static/img/bg.png);
		}
	</style>
	<script type="text/javascript" src="static/js/jquery.js"></script>
	<script type="text/javascript" src="static/js/bootstrap.js"></script>
</head>
<body class="body">
	
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="brand" href="#">Kaishengit PMS</a>
			</div>
		</div>
	</div>
	
	
	<div class="container">
	  <div class="row" style="margin-top:60px">
		<div class="span3">
			<div style="padding: 8px 0;" >
				<ul class="nav nav-list">
				  <li class="nav-header"  style="font-size:14px">${sessionScope.userProject.project.name }</li>
				  <li class="divider"></li>
				  <li><a href="project.jspx"><i class="icon-home"></i>最新动态</a></li>
				  <li>
					<a href="goal.jspx"><i class="icon-flag"></i>目标</a>
				  </li>
				  <li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
				  <li><a href="files.jspx"><i class="icon-file"></i>文件共享</a></li>
				  <li><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>
				  <li class="active"><a href="idea.jspx"><i class="icon-white icon-fire"></i>想法</a></li>
				  <li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
				  <li><a href="set.jspx"><i class="icon-cog"></i>项目设置</a></li>
				</ul>
			</div>
		</div>
		<div class="span9">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
				<li class="active">
					<a href="http://pms.kaishengit.com/idea.html"><i class="icon-fire"></i>想法</a>&gt;${idea.title }
				</li>
				
			</ul>
			
			 <c:set value="${idea.createtime }" var="time"></c:set>
								<%String time1 = (String)pageContext.getAttribute("time"); %>
			<div class="wall">
			<div style="border:2px solid #ddd;" >

					 <div class = "row">
					  <div class="page-header ; span4" >
						<h3 style = "padding-left:50px">${idea.title}&nbsp;&nbsp;</small></h3>
					  </div>
					  <div class="span1" >					
				 				<img style = "padding-top:10px" alt="" src="idea.jspx?m=showImg&img=${userpic }">
				 	  </div>
				 	  <div class="span4" style = "padding-top:40px">					
				 			<small  >  ${username}  发布于 <%=IntervalUtil.getInterval(time1)%></small>			
				 	  </div>
				  
				  	</div>
				  </div>				
				
				
				<div>	  
				  <p style = "padding-left:10px; padding-right:10px">${idea.content }</p>
				 </div>
				 			
										
				  <div class="line" style = "padding-left:20px">
					评论
				  </div>
				  <form id = "myform" method = "post" action = "idea.jspx?m=comment&id=${idea.id }">
					<textarea name="comment" id="" class="span8" rows="5"></textarea>
					<br>
					<button class="btn" id = "btnSave">发布</button>
				  </form>
				 
				 <c:forEach items = "${commentList}" var = "comment">
				  <c:set value="${comment.createtime }" var="time2"></c:set>
								<%String time = (String)pageContext.getAttribute("time2"); %>
				
				 <img alt="" src="idea.jspx?m=showImg&img=${comment.user.pic }">
			
		 <blockquote>  
		
				 	${comment.content }
				
				  <small>
				  
					          ${comment.user.name } 发布于<%=IntervalUtil.getInterval(time)%>
					<a href="idea.jspx?m=editcomment&id=${comment.id}&ideaid=${idea.id}" title="编辑" id = "editbtn"><i class="icon-pencil"></i></a>
				    <a href="idea.jspx?m=delcomment&id=${comment.id}&ideaid=${idea.id}" title="删除"><i class="icon-trash"></i></a>
				  </small>
			</blockquote>  
			
			 <input type="hidden" id="ideaid" value="${idea.id}"/>
			  <input type="hidden" id="commentid" value="${comment.id}"/>
			
				</c:forEach>
				
			
				<a href="idea.jspx">←返回想法列表</a>
			</div>
		</div>
	  </div>
	</div>
	
	<script type = "text/javascript" src = "static/js/jquery.js"></script>
	<script type = "text/javascript">
		$(document).ready(function(){
			$("#btnSave").click(function(){
				$("#myform").submit();
			
			});
		
		});
		

	</script>

</body></html>